import VueRouter from 'vue-router'


//引入路由组件
import Home from "./components/tabbar/HomeContainer.vue";
import Member from "./components/tabbar/MemberContainer.vue";
import Shopcar from "./components/tabbar/ShopcarContainer.vue";
import Search from "./components/tabbar/SearchContainer.vue";
import NewsList from "./components/news/NewsList.vue";
import NewsInfo from "./components/news/NewsInfo.vue";
import  PhotoList from "./components/photo/PhotoList.vue";
import GoodsList from "./components/goods/GoodsList.vue";
import GoodsInfo from "./components/goods/GoodsInfo.vue";

// 3. 创建路由对象
var router = new VueRouter({
  routes: [//配置路由规则
    {path:"/",redirect:"/home"},
    {path:"/home",component:Home},
    {path:"/member",component:Member},
    {path:"/search",component:Search},
    {path:"/shopcar",component:Shopcar},
    {path:"/home/newsList",component:NewsList},
    {path:'/home/newsInfo/:id',component:NewsInfo},
    {path:'/home/photoList',component:PhotoList},
    {path:"/home/goodslist",component:GoodsList},
    {path:"/home/goodsInfo",component:GoodsInfo}
  ],
  linkActiveClass:"mui-active",
})

// 把路由对象暴露出去
export default router